package model;

/**
 * represent the basic parameter common for preprocessor and solver
 * @author stephane
 *
 */
public class BasicParameter {
	public static final int DEFAULT_DELAY = 600 * 1000;
	public static final int MIN_DELAY = 1000;
	public static final int NO_DELAY = -4;
	
	
	/**time in millisecond before the preprocessor will be force to stop*/
	protected int timeOut = DEFAULT_DELAY; 
	


	public int getTimeOut() {
		return timeOut;
	}


	/**
	 * change the timeout parameter 
	 * @param timeOut the timeout
	 */
	public void setTimeOut(int timeOut){
	//	if(timeOut != BasicParameter.NO_DELAY && timeOut < BasicParameter.MIN_DELAY)
		//	return false;
		
		this.timeOut = timeOut;
		//return true;
	}

	public boolean needTimeOut() {
		if(timeOut == NO_DELAY)
			return false;
		else
			return true;
		
	}

	public BasicParameter() {
		// TODO Auto-generated constructor stub
		
	}

	/**
	 * check if the parameters respect are coherent : like if the timeout is correct
	 * @return
	 */
	public boolean basicCheck(){
		if(timeOut != NO_DELAY && timeOut < MIN_DELAY)
			return false;
		
		return true;
	}
}
